package com.swz.dcrm.adpter;

import android.content.Context;

import com.swz.dcrm.R;
import com.swz.dcrm.base.ViewHolder;
import com.swz.dcrm.model.Car;

import java.util.List;

public class CarAdapter extends CustomAdapter<Car> {
    public CarAdapter(Context context,  List<Car> datas) {
        super(context, R.layout.item_car, datas);
    }

    @Override
    protected void convert(ViewHolder holder, Car car, int position) {
        holder.setText(R.id.tv_car_model,car.getCarModel());
        holder.setText(R.id.tv_car_num,car.getCarFrame());
        if(car.getWarehouseTime()==null){
            holder.setText(R.id.tv_storage_date,mContext.getString(R.string.item_inventory_time1,car.getExpectedDateOfArrival()));
        }else {
            holder.setText(R.id.tv_storage_date,mContext.getString(R.string.item_inventory_time,car.getWarehouseTime()));
        }

        holder.setText(R.id.tv_color,car.getCarColor().split(":")[0]);
    }
}
